<!-- 工单查看页面 -->
<template>
  <div class="form-detail-container">
    <ul>
      <li class="setion">
        <div class="head">工单信息</div>
        <formMainListItem
          v-for="(mod, index) in watchFormInfoList"
          :key="index"
          :mod="mod"
          class="item"
        ></formMainListItem>
        <img src="@/assets/img/form/form_section_bg.png" />
      </li>
      <li class="setion apple">
        <div class="head">{{ appleInfoTitle }}</div>
        <formMainListItem
          v-for="(mod, index) in watchAppleList"
          :key="index"
          :mod="mod"
          class="item"
        ></formMainListItem>
        <img src="@/assets/img/form/form_section_bg.png" />
        <div class="file-section" v-if="formType == FormTypeEnum.TODO && formParams.fileUrl ">
          <div class="title">附件图片</div>
          <img class="file" :src="'https://12345.shsports.cn' + formParams.fileUrl">
        </div>
      </li>

      <li
        class="setion"
        v-show="
          formParams.findingOfAudit != '1' && formParams.findingOfAudit != null
        "
      >
        <div class="head">审核信息</div>
        <formMainListItem
          v-for="(mod, index) in watchReviewList"
          :key="index"
          :mod="mod"
          class="item"
        ></formMainListItem>
        <img src="@/assets/img/form/form_section_bg.png" />
      </li>
    </ul>
  </div>
</template>

<script setup>
import formMainListItem from "@/components/formMainListItem.vue";
import { useFormDetail } from "@/category/useFormDetail";
import { useFormManage } from "@/category/useFormManage";
import { onMounted } from "vue";
import { FormTypeEnum } from "@/utils/enum";
const { formType, formParams, getFormDetail } = useFormManage();

const {
  appleInfoTitle,
  watchFormInfoList,
  watchAppleList,
  watchReviewList,
  // switchManageList,
} = useFormDetail(formParams);

onMounted(() => {
  getFormDetail();
});
</script>

<script>
export default {
  name: "formDetail",
};
</script>

<style lang="less" scoped>
.form-detail-container {
  .setion {
    margin: 40px 28px;
    width: calc(100% - 56px);
    background: #fefeff;
    box-shadow: 0px 8px 48px 0px rgba(4, 10, 41, 0.06);
    border-radius: 4px;
    min-height: 100px;
    height: auto;
    position: relative;

    .head {
      font-size: 36px;
      font-weight: 600;
      color: #333333;
      line-height: 98px;
      height: 98px;
      padding-left: 28px;
    }
    .item {
      z-index: 2;
      min-height: 80px;
      height: auto;
      padding-top: 10px;
    }
    img {
      width: 226px;
      height: 240px;
      position: absolute;
      right: 0;
      bottom: 0;
      object-fit: contain;
    }

    .file-section {
      width: 100%;
      height: 320px;
      .title {
        height: 80px;
        margin-top: 26px;
        margin-left: 28px;
        color: #666666;
        font-size: 28px;
      }
      .file {
        margin: 0px 28px 20px 28px;
        height: 220px;
        width: calc(100% - 56px);
      }
    }
  }

  .apple {
    min-height: 200px;
    height: auto;
    img {
      height: 212px;
    }
  }

  .foot {
    margin: 40px 28px;
    width: calc(100% - 56px);
    height: 88px;
    .btn-style {
      width: 100%;
      height: 100%;
      font-size: 32px;
      font-family: PingFangSC-Medium, PingFang SC;
      font-weight: 500;
      line-height: 44px;
      border-radius: 4px;
      color: white;
      border: 2px solid #0378fe;
      background: #0378fe;
    }
  }
}
</style>
